﻿using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Alison.EFCore.Dto
{
	/// <summary>
	/// 用户
	/// </summary>
	[SwaggerSchema(Title = "用户UserDto", Description = "用户Class")]
	public class UserDto : BaseDto
	{ 
		/// <summary>
		/// 账户名称
		/// </summary>
		[JsonProperty("account")]
		[Description("账户名称")]
		[SwaggerSchema(Title = "用户", Description = "账户名称")]
		[StringLength(20, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 2)]
		public string Account { get; set; }

		/// <summary>
		/// 用户名
		/// </summary> 
		[JsonProperty("userName")]
		[Description("用户名")]
		[SwaggerSchema(Title = "用户", Description = "用户名")]
		[StringLength(20, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 2)]
		public string UserName { get; set; }

		/// <summary>
		/// 地址
		/// </summary>
		[JsonProperty("address")]
		[Description("地址")]
		[SwaggerSchema(Title = "用户", Description = "地址")]
		public string Address { get; set; }

		/// <summary>
		/// 电话
		/// </summary>
		[JsonProperty("tel")]
		[Description("电话")]
		[SwaggerSchema(Title = "用户", Description = "电话")]
		public string Tel { get; set; }

		/// <summary>
		/// 邮箱
		/// </summary>
		[JsonProperty("email")]
		[Description("邮箱")]
		[SwaggerSchema(Title = "用户", Description = "邮箱")]
		public string Email { get; set; }

		/// <summary>
		/// 密码
		/// </summary>
		[JsonProperty("password")]
		[SwaggerSchema(Title = "用户", Description = "密码")]
		public string Password { get; set; }

		/// <summary>
		/// 最后登录时间
		/// </summary>
		[JsonProperty("lastLoginTime")]
		[SwaggerSchema(Title = "用户", Description = "最后登录时间")]
		public DateTime? LastLoginTime { get; set; }

		/// <summary>
		/// 最后登出时间
		/// </summary>
		[JsonProperty("lastLogouTime")]
		[SwaggerSchema(Title = "用户", Description = "最后登出时间")]
		public DateTime? LastLogouTime { get; set; }

		/// <summary>
		/// 是否锁定
		/// </summary>
		[JsonProperty("isLocked")]
		[SwaggerSchema(Title = "用户", Description = "是否锁定")]
		public int? IsLocked { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty("createTime")]
		[SwaggerSchema(Title = "用户", Description = "创建时间")]
		public DateTime? CreateTime { get; set; }

		/// <summary>
		/// 是否为管理员  0/1 false/true
		/// </summary>
		[JsonProperty("flagAdmin")]
		[SwaggerSchema(Title = "用户", Description = "是否为管理员  0/1 false/true")]
		public int? FlagAdmin { get; set; }

		/// <summary>
		/// 是否在线
		/// </summary>
		[JsonProperty("flagOnline")]
		[SwaggerSchema(Title = "用户", Description = "是否在线")]
		public string FlagOnline { get; set; }

		/// <summary>
		/// 登录次数
		/// </summary>
		[JsonProperty("loginCounter")]
		[SwaggerSchema(Title = "用户", Description = "登录次数")]
		public int? LoginCounter { get; set; }
	}
}
